import Vue from 'vue'

const preventDbClick = Vue.directive('preventDbClick', {
    inserted: function (el, binding) {
        el.addEventListener('click', () => {
            if (!el.disabled) {
                el.disabled = true
                setTimeout(() => {
                    el.disabled = false
                }, 3000)
            }
        })
    }
});

export {
    preventDbClick
}

// https://www.jianshu.com/p/a88d01b9d427